package util;

import java.sql.Connection;
import java.sql.DriverManager;

public class Util {
    public static Connection getConnection() throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://localhost:3306/elm";
        Connection con = DriverManager.getConnection(url, "root", "123");
        return con;
    }

    public static void closeConnection(Connection con) throws Exception{
        if(con != null)con.close();
    }
}
